const net = require('net')
const server = net.createServer()
server.on('connection', clientSocket => {
  console.log('有新的soket连接')
  //监听 clientSocket 
  clientSocket.on('data', data => {
    console.log('客户端说:',data.toString())
  })
  //get客户端发送消息
  //通过 clientSocket
  clientSocket.write('hello,kehu')
})
server.listen(3001, () =>  console.log('socket running http://127.0.0.1:3001') )